<template>
  <view>
    <e-navbar :leftTitle="title"></e-navbar>
    <view class="p-20">
      <u-parse :content="content" :tagStyle="tagStyle"></u-parse>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      title: "",
      content: "",
      tagStyle: {
        // 字符串的形式
        p: 'font-size:26rpx',
        span: 'font-size: 26rpx'
      }
    };
  },
  onLoad(options) {
    if(options.type){
      this.type = options.type;
      this.getAgreement(this.type);
    }
  },
  methods: {
    async getAgreement(type) {
      const res = await this.$api.agreement({key: type});
      if(res.code == 1){
        this.content = res.data.content;
        this.title = res.data.title;
      }
    }
  }
}
</script>

<style lang="scss">

</style>
